<%@page import="study.top.mydb.items.MemberItem"%>
<%@page import="study.top.mydb.Product"%>
<%@page import="java.net.URLEncoder"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page trimDirectiveWhitespaces="true"%>
<%@ page session="true" %>
<%@ include file="dbcon.jsp"%>
<%
	boolean login = false;
	String mem_id = null;

	MemberItem memberItem = (MemberItem) session
			.getAttribute("MemberItem");

	if (memberItem != null) {
		login = true;
		mem_id = memberItem.getId();
	}else{
		web.goPage(null, "로그인을 해야 추천이 가능합니다.");
	}

	int pseq = web.getInt("prono");

	Product re_Pro = new Product();
	boolean result = re_Pro.ProductRecommend(pseq);

	if (!result) {
		web.goPage(null, "해당하는 상품에 추천하지 못하였습니다.");
	}
%>
<!DOCTYPE html>
<html lang="ko">
<%@ include file ="topHead.jsp" %>

<body>
	<!--  상품번호 자동입력  <input type="hidden" name="prono" value="<=seq%>">-->
	
	<div class="container">
		<div class="page-header">
			<h5 small text-align="center">
				<%=mem_id%>님 해당 상품에 추천 하셨습니다.<br /> <br />
			</h5>
		</div>
		<div align="center">
				<a id="uProductDetailView.jsp?active=S&seq=<%=pseq%>"
				class="btn btn-sm btn-custom" onclick="commit();">확인 </a>
		</div>
	</div>
	<!-- Javascript -->
	<script src="assets/js/jquery.js"></script>
	<script src="assets/js/bootstrap.min.js"></script>
	<script type="text/javascript">
		$(function commit() {
			$("a.btn").click(function() {
				// id에 값을 url에 부여
				var url = $(this).attr("id");
				window.opener.location = url;
				self.close();
			});
		});
	</script>

</body>
</html>

